package com.heima.feigns;

import com.heima.config.HeimaFeignAutoConfiguration;
import com.heima.feigns.fallback.AdminFeignFallback;
import com.heima.model.admin.pojos.AdChannel;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * @package com.heima.feigns
 * @Date 2022/3/1
 * @project heima-leadnews
 */
@FeignClient(
        value = "leadnews-admin",
        configuration = HeimaFeignAutoConfiguration.class,
        fallbackFactory = AdminFeignFallback.class
)
public interface AdminFeign {
    @PostMapping("/api/v1/sensitive/sensitives")
    public ResponseResult<List<String>> sensitives();

    @GetMapping("/api/v1/channel/one/{id}")
    public ResponseResult<AdChannel> selectOne(@PathVariable("id") Integer id);
}
